home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
DBL Pascal Library
/
ErrSignal
/
TestSignals_1.p
< prev
next >
Wrap
Text File
|
1991-03-29
|
1KB
|
93 lines
program TestSignals;
uses
ErrSignal;
type
foo = object
procedure bar (a, b: integer);
end;
procedure Proc1;
var
catch: OSErr;
label
99;
begin
{• Signal(9);•}
catch := CatchSignal;
if catch <> noErr then
begin
writeln('catch in Proc1 returned ', catch : 1);
SignalHandlerDone;
{• goto 99;•}
Exit(Proc1);
TerminateSignalHandler;
end;
if CatchInBlock then
writeln('catch established in Proc1');
Signal(2);
99:
end;
procedure foo.bar (a, b: integer);
begin
a := b + 1;
end;
procedure Proc2;
var
baz: foo;
begin
Proc1;
Signal(3);
new(baz);
baz.bar(1, 2);
end;
procedure Start;
var
catch: OSErr;
begin
InitSignals(sigFail);
catch := CatchSignal;
if catch <> noErr then
begin
writeln('catch in Start returned ', catch : 1);
Halt;
end;
writeln('catch established in Start');
Proc2;
end;
procedure Proc3 (a: Boolean);
label
99;
procedure Proc4;
procedure Proc5;
procedure Proc6;
procedure Proc7;
begin
if a then
goto 99;
end; {Proc7}
begin
Proc7;
Exit(Proc5);
end; {Proc6}
begin
Proc6;
end; {Proc5}
begin
Proc5;
end; {Proc4}
begin
Proc4;
99:
end; {Proc3}
begin
ShowText;
Start;
end.